package goleetcode

func countCompleteDayPairs2(hours []int) int64 {
	var res int64
	cnt := make([]int, 24)
	for _ , hour := range hours {
		res += int64(cnt[(24 - hour % 24) % 24])
		cnt[hour % 24]++
	}
	return res
}